package com.droid.activities;

import com.droid.activities.R;
import com.droid.utilities.ConstantsFile;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class PatientDetails extends Activity{
    /** Called when the activity is first created. */
 
    
    
	private static EditText patientid;
	
	//patientid.setVisibility(4);
	
	private static EditText patientName;
	private static EditText Email;
	private static EditText patientAge;
	private static EditText bloodType;
	private static EditText gender;
	private static EditText bloodPressure;
	private static EditText allergies;
	private static EditText diagnosis;
	private static EditText primaryDoc;
	private static EditText secondaryDoc;
    
    
	   @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        // load up the layout
        setContentView(R.layout.detailspatientview);
       
        // get the button resource in the xml file and assign it to a local variable of type Button
        Button create=(Button) findViewById(R.id.Create_button);
        create.setVisibility(4);
        Button update=(Button) findViewById(R.id.Update_button);
        update.setVisibility(4);
        Button refer=(Button) findViewById(R.id.Refer_button);
        refer.setVisibility(4);
       
        Button btnLogout = (Button) findViewById(R.id.Logout_button);
        
        
        
        Button btnBack = (Button)findViewById(R.id.back_button);
        
        btnBack.setVisibility(4);
        		
        
        
        btnBack.setOnClickListener(new OnClickListener() {
 	 	   
       	    public void onClick(View v) {
	System.out.println("inside back button !!!!!!!!!!!!!!!!!!!!!!!! ");
       	    	
		try {
			ConstantsFile.foreignContext = createPackageContext(ConstantsFile.packageName, Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE);
			ConstantsFile.loginClass = (Class<Doctor_Login>) ConstantsFile.foreignContext.getClassLoader().loadClass(ConstantsFile.login);
			Intent intent = new Intent(PatientDetails.this, ConstantsFile.loginClass);
     	   startActivity(intent);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

       	    }
});
       
     // Log out by loading up the Login screen

		btnLogout.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {

				System.out.println("Logout initiated..");


				
				Intent intent = new Intent(v.getContext(), ConstantsFile.loginClass);
				startActivityForResult(intent, 0);


				finish();

			}

		});
        
        
    }
}